//
//  EnergyAnalysisView.h
//  cocoapodText
//
//  Created by apple on 16/9/9.
//  Copyright © 2016年 apple. All rights reserved.
//

#ifndef EnergyAnalysisView_h
#define EnergyAnalysisView_h


#endif /* EnergyAnalysisView_h */
//导入时需要手动打上，系统没有提示
#import "Charts-Swift.h"
#import "CommonTool.h"
#import "NirKxMenu.h"
#import <UIKit/UIKit.h>
#import "queryDataInfo.h"
#import "MyUIDatePicker.h"
#import "energyTableCell.h"
#import "queryDataTableCell.h"
#import "queryDataTableCellView.h"
#import "FSSwitchMenuChangeTrend.h"

@class EnergyAnalysisView;

//一个协议可以扩展另一个协议，例如FSLoginViewDelegate扩展了NSObject协议
@protocol GYEnergyAnalysisViewDelegate <NSObject>

@required //@required修饰的方法必须实现
-(void)switchChangeTrend:(EnergyAnalysisView*)energyAnalysisView flag:(int)end;
-(void)onQueryChartData:(EnergyAnalysisView*)energyAnalysisView esCode:(NSString *)esCode xslx:(NSString *)xslx startTime:(NSString *)startTime endTine:(NSString *)endTime orgid:(NSString *)orgid structType:(NSString *)structType;
-(void)onInitFristChartTableData:(EnergyAnalysisView*)energyAnalysisView esCode:(NSString *)esCode;
@end

@interface EnergyAnalysisView : UIView<ChartViewDelegate>
//全局背景
@property(nonatomic,strong)UIView *AllBackView;
//左侧菜单
@property(nonatomic,strong)FSSwitchMenuChangeTrend *menu;
@property(nonatomic,strong)UITableView *GYMeunTableView;
///右侧查询
//右侧全背景
@property(nonatomic,strong)UIView *rightAllBackView;
/**************************/
//正在操作的menu
@property(nonatomic,retain)NSString *currentMenu;
//选择条件
@property(nonatomic,strong)UILabel *energyTypeMenu;
@property(nonatomic,strong)UILabel *showTypeMenu;
@property(nonatomic,strong)UILabel *startTimeMenu;
@property(nonatomic,strong)UILabel *endTimeMenu;
@property(nonatomic,retain)NSString *energyType;
@property(nonatomic,retain)NSString *xslxType;
@property(nonatomic,retain)NSString *startTime;
@property(nonatomic,retain)NSString *endTime;
@property(nonatomic,retain)NSString *orgid;
@property(nonatomic,retain)NSString *structType;
/*************************/
//右侧滑动背景
@property(nonatomic,strong)UIScrollView *chartAndQueryTableBack;
//表格
@property(nonatomic,strong)UITableView *queryTableView;
//表格头部
@property(nonatomic,strong)UIView *queryTabletopView;
@property(nonatomic,strong)queryDataTableCellView *tableCellView;
//表格横向滑动
@property(nonatomic,strong)UIScrollView *queryTableBack;
//时间选择
@property(nonatomic,strong)MyUIDatePicker *datePicker;
@property(nonatomic)BOOL is_picker_show;
@property(nonatomic,strong)UIView *pickerOverlay;

//折线图
@property(nonatomic,strong)UILabel *chartTitle;
@property(nonatomic,strong)LineChartView *energyLineChart;
#pragma mark 折线图数据
@property(nonatomic,retain)NSMutableArray *xValsEnergyLine;
@property(nonatomic,retain)NSMutableArray *yValsEnergyLine;
@property(nonatomic,retain)NSMutableArray *lineColors;
@property(nonatomic,retain)NSArray *legend;
@property(nonatomic,retain)NSString *unit;

#pragma mark - 属性
#pragma mark 代理属性，同时约定作为代理的对象必须实现KCButtonDelegate协议
@property (nonatomic,retain) id<GYEnergyAnalysisViewDelegate> delegate;

#pragma mark - 公共方法
-(void)lineChartData;
-(void)multipleLineChartData;
-(void)setGYMenuTableData:(NSArray *)array;
-(void)setGYMenuEnergyTypeData:(NSArray *)array;
-(void)switchChangeTrend:(NSString *)structType;
-(void)setEnergyTableWithxAxis:(NSArray *)xAxis yAxiss:(NSArray *)yAxiss legend:(NSArray *)legend;
-(void)changeTabItemStyle:(NSInteger)tag;
-(void)dismissMenu;
@end
